package services.core;

import java.util.List;

import models.BeanDtoInfo;
import models.core.catalog.VigneronDto;
import models.core.catalog.VinDto;
import play.libs.F.Promise;
import services.ServiceException;

public class CatalogService extends CoreService {
	
	public static Promise<VigneronDto> getVigneron(String key) throws ServiceException {
		return get( VigneronDto.class, "/catalog/vigneron/key:", key );
	}
	
	public static Promise<VinDto> getVin(String key) throws ServiceException {
		return get( VinDto.class, "/catalog/vin/key:", key );
	}
	
	public static Promise<List<BeanDtoInfo>> getList(String key) throws ServiceException {
		return getCollection(BeanDtoInfo.class, "/catalog/list/key:", key);
	}
	
	public static Promise<BeanDtoInfo> getContent(String key) throws ServiceException {
		return get(BeanDtoInfo.class, "/catalog/content/key:", key);
	}
	
	public static Promise<VigneronDto> getVigneron(Integer id) throws ServiceException {
		return get( VigneronDto.class, "/catalog/vigneron/", id + "");
	}
	
	public static Promise<VinDto> getVin(Integer id) throws ServiceException {
		return get( VinDto.class, "/catalog/vin/", id + "");
	}
	
	public static Promise<List<BeanDtoInfo>> getList(Integer id) throws ServiceException {
		return getCollection(BeanDtoInfo.class, "/catalog/list/", id + "");
	}
	
}
